﻿using UnityEngine;
using UnityEngine.UI;

public class StartScene : ISceneState
{
    public StartScene(SceneStateController controller) : base(Definitions.StartScene, controller)
    {
    }

    private Image mLogoImg;
    private float mSmoothSpeed = 0.5f;

    private float mWaitTime = 2f;

    public override void StateStart()
    {
        mLogoImg = GameObject.Find("LogoImg").GetComponent<Image>();
        mLogoImg.color = Color.black;
    }

    public override void StateUpdate()
    {
        mLogoImg.color = Color.Lerp(mLogoImg.color, Color.white, mSmoothSpeed * Time.deltaTime);
        mWaitTime -= Time.deltaTime;
        if (mWaitTime <= 0)
        {
            mController.SetState(new MainMenuScene(mController));
        }
    }
}